def isPalindrome_word(s):
	"""
	Returns whether the given list (or word) is a palindrome.
	>>> print isPalindrome_word([])
	True
	>>> print isPalindrome_word("")
	True
	>>> print isPalindrome_word("12")
	False
	>>> print isPalindrome_word("aa")
	True
	>>> print isPalindrome_word("rotor")
	True
	>>> print isPalindrome_word("rotox")
	False
	"""
	for i in range(0, len(s)/2):
		if s[i] != s[len(s)-i-1]:
			return False
	return True

def isPalindrome_strings(s):
	"""
	Returns whether the given string is a palindrome.
	>>> print isPalindrome_strings([])
	True
	>>> print isPalindrome_strings("")
	True
	>>> print isPalindrome_strings("12")
	False
	>>> print isPalindrome_strings(" a a")
	True
	>>> print isPalindrome_strings("aa")
	True
	>>> print isPalindrome_strings("rotor")
	True
	>>> print isPalindrome_strings("rot    ox")
	False
	>>> print isPalindrome_strings("rotox")
	False
	>>> print isPalindrome_strings("a man  a plan  a canal  panama")
	True
	>>> print isPalindrome_strings("  ")
	True
	>>> print isPalindrome_strings(" ")
	True
	"""
	x = y = ""
	for c in s:
		if c != ' ':
			x += c
			y = c + y
	return x==y

def isPalindrome_func(s, blank=' '):
	"""
	Returns whether the given string is a palindrome.
	>>> print isPalindrome_func([])
	True
	>>> print isPalindrome_func("")
	True
	>>> print isPalindrome_func("12")
	False
	>>> print isPalindrome_func(" a a")
	True
	>>> print isPalindrome_func("aa")
	True
	>>> print isPalindrome_func("rotor")
	True
	>>> print isPalindrome_func("rot    ox")
	False
	>>> print isPalindrome_func("rotox")
	False
	>>> print isPalindrome_func("a man  a plan  a canal  panama")
	True
	>>> print isPalindrome_func("  ")
	True
	>>> print isPalindrome_func(" ")
	True
	"""
	s = filter(lambda x: x!=blank, s)
	return s==s[::-1]

def isPalindrome_indices_recursive(s, a=0, b=False):
	"""
	Returns whether the given string is a palindrome.
	Tail-recursive version of isPalindrome_indices.
	>>> print isPalindrome_indices_recursive([])
	True
	>>> print isPalindrome_indices_recursive("")
	True
	>>> print isPalindrome_indices_recursive("12")
	False
	>>> print isPalindrome_indices_recursive(" a a")
	True
	>>> print isPalindrome_indices_recursive("aa")
	True
	>>> print isPalindrome_indices_recursive("rotor")
	True
	>>> print isPalindrome_indices_recursive("rot    ox")
	False
	>>> print isPalindrome_indices_recursive("rotox")
	False
	>>> print isPalindrome_indices_recursive("a man  a plan  a canal  panama")
	True
	>>> print isPalindrome_indices_recursive("  ")
	True
	>>> print isPalindrome_indices_recursive(" ")
	True
	"""
	if b==False:
		#first call, default value
		b = len(s)-1
	if a >= b:
		return True
	elif s[a] == ' ':
		return isPalindrome_indices_recursive(s, a+1, b)
	elif s[b] == ' ':
		return isPalindrome_indices_recursive(s, a, b-1)
	elif s[a] != s[b]:
		return False
	else:
		return isPalindrome_indices_recursive(s, a+1, b-1)

def isPalindrome_indices(s):
	"""
	Returns whether the given string is a palindrome.
	>>> print isPalindrome_indices([])
	True
	>>> print isPalindrome_indices("")
	True
	>>> print isPalindrome_indices("12")
	False
	>>> print isPalindrome_indices(" a a")
	True
	>>> print isPalindrome_indices("aa")
	True
	>>> print isPalindrome_indices("rotor")
	True
	>>> print isPalindrome_indices("rot    ox")
	False
	>>> print isPalindrome_indices("rotox")
	False
	>>> print isPalindrome_indices("a man  a plan  a canal  panama")
	True
	>>> print isPalindrome_indices("  ")
	True
	>>> print isPalindrome_indices(" ")
	True
	"""
	i = 0
	j = len(s)-1
	while i < j:
		if s[i] == ' ':
			i += 1
		elif s[j] == ' ':
			j -= 1
		elif s[i] != s[j]:
			return False
		else:
			i += 1
			j -= 1
	return True


if __name__ == "__main__":
	import sys
	import os.path
	if len(sys.argv)>=2 and sys.argv[1]=="--test":
		import doctest
		doctest.testmod()
	else:
		inp = "".join(map(lambda x: x[:-1], sys.stdin.readlines()))
		print "\"%s\"" % inp,
		if isPalindrome_indices(inp):
			print "is a palindrome."
			exit(0)
		else:
			print "isn't a palindrome."
			exit(1)
